package com.itheima;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itheima.mapper.EmpMapper;
import com.itheima.pojo.Emp;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class demo01 {

    @Autowired
    private EmpMapper empMapper;

    @Test
    public void demo01() {
        LambdaQueryWrapper<Emp> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(Emp::getName, "李")
                .ge(Emp::getSalary, 5000)
                .select(Emp::getId, Emp::getName, Emp::getJob);
        List<Emp> list = empMapper.selectList(wrapper);
        System.out.println(list);
    }
}
